<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <img src="tianshi.gif" alt="">
    <script>
        var pic = document.querySelector('img')
        var timer = null

        document.onmousemove = function(e) {
            if (timer) {
                return
            }
            timer = setTimeout(function() {
                pic.style.position = 'absolute'
                var x = e.pageX
                var y = e.pageY
                pic.style.left = x - pic.offsetWidth / 2 + 'px'
                pic.style.top = y - pic.offsetHeight / 2 + 'px'
                console.log(1);
                timer = null
            }, 100)

        }
    </script>
</body>

</html>